
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title>Ruby Library Manager</title>
        <%= stylesheet_link_tag "admin" %>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>

    <body>
        <!-- Header of the page -->
        <!-- Your should use ruby code to include header file here, default html can not include file -->
        <div id="header">
            <div id="header_infos">
                <span id="header_shopname">
                    <span>Ruby Library Manager</span>
                </span>
                <span id="employee_links">
                    <span class="employee_name">Trang Quản lí</span>
                    <span class="separator"></span>
                    <a id="header_logout" href="/logout">
                        <span>Thoát</span>
                    </a>
                </span>

            </div>
            <ul id="menu">
                <li id="maintab0" class="submenu_size maintab">
                    <span class="title">
                    	<%= image_tag "home-icon.png", :alt => "", :height => 20%>                       
                        <a style="color:white" href="/admin/home"> Trang chủ </a>
                    </span>
                </li>
                <li id="maintab1" class="submenu_size maintab">
                    <span class="title">                        
                        <%= image_tag "try-product.png", :alt => "", :height => 20%>             
                        <a style="color:white" href="/admin/book"> Sách</a>
                    </span>
                </li>
                <li id="maintab2" class="submenu_size maintab">
                    <span class="title">                        
                        <%= image_tag "try-category.png", :alt => "", :height => 20%>             
                        <a style="color:white" href="/admin/categories"> Danh mục </a>
                    </span>
                </li>
                <li id="maintab3" class="submenu_size maintab">
                    <span class="title">                        
                        <%= image_tag "try-customer.png", :alt => "", :height => 20%>    
                        <a style="color:white" href="admin_book.html"> Tài khoản </a>
                    </span>
                </li>
                <li id="maintab4" class="submenu_size maintab">
                    <span class="title">                       
                        <%= image_tag "try-auction.gif", :alt => "", :height => 20%>    
                        <a style="color:white" href="/admin/borrow"> Mượn sách </a>
                    </span>
                </li>
            </ul>
        </div>
        <!-- Admin home content -->
         <div id="main">
            <div id="content">
                <div class="pageTitleHome">
                    <span>
                        <h3> Thông tin</h3>
                    </span>
                </div>
                <br/>
                <br/>
                <br/>
                <div id="dashboard">
                    <div id="column_left" style="width:100%">
                        <h2 style="float:left">Sách đang cho mượn </h2>
                        <div class="clear"/>
                                              
                    </div>
                        <div class="clear"></div>
                        <br/>
                        <h2 style="float:left">Thống kê</h2>
                    <div id="column_right" style="width:100%">

                        <div class="table_info">
                            <h5>                               
                                Thành viên
                            </h5>
                            <table class="table_info_details" style="width:100%;">
                                <colgroup>
                                    <col width="">
                                    <col width="80px">
                                </colgroup>
                                <tbody>
                                    <tr class="tr_odd">
                                        <td style="float:left;margin-left:5px"> Tổng cộng</td>
                                        <td> <%= User.all.count %></td>
                                    </tr>                                    
                                </tbody>
                            </table>
                        </div>
                        <div id="table_info_last" class="table_info">
                            <h5>                                
                               Sách đang có
                            </h5>
                            <table class="table_info_details" style="width:100%;">
                                <colgroup>
                                    <col width="">
                                    <col width="80px">
                                </colgroup>
                                <tbody>               	
                                	<% Category.all.each do |item|%>
                                    <tr class="tr_odd">
                                        <td style="float:left;margin-left:5px"> <%= item.name %></td>
                                        <td> <%= item.books.count %> </td>                                        
                                    </tr>                                   
                                    <% end %>
                                    <tr class="tr_odd">
                                        <td style="float:left;margin-left:5px"> Tổng cộng</td> 
                                        <td> <%= Book.all.count %> </td>                                                          
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>
</html>
